package fi.jamk.ourcookingapp.backend.architecture.interfaces;

import java.util.List;
import java.util.concurrent.ExecutionException;

import org.json.JSONException;

import fi.jamk.ourcookingapp.backend.model.Comment;
import fi.jamk.ourcookingapp.backend.model.Receipt;

/**
 * Interface for the comment actions.
 * @author Marius
 */
public interface ICommentManager {
	
	/**
	 * Creates a comment in the database and retruns it with id.
	 * @param comment
	 * @return boolean created
	 * @throws InterruptedException
	 * @throws ExecutionException
	 * @throws JSONException
	 */
	public boolean createComment(Comment comment) throws InterruptedException, ExecutionException, JSONException;
	
	/**
	 * Get comments for the given receipt.
	 * @param receipt
	 * @return List<Comment> for the receipt
	 * @throws InterruptedException
	 * @throws ExecutionException
	 * @throws JSONException
	 */
	public List<Comment> commentsByReceipt(Receipt receipt) throws InterruptedException, ExecutionException, JSONException;
	
}
